package com.dev;

import java.io.FileDescriptor;

public class DevPosix {

	public DevPosix() {
		super();
	}

	public final static native int open(String path);//打开虚拟设备文件;

	public final static native int write(int fd,byte[] buffer,int len);//根据获取到的虚拟设备文件写入数据;

	public final static native byte[] read(int fd);//从虚拟设备文件中读取byte数据流;

	public final static native int openSP(String spDevPath,int iSpeed,int iFlags);//打开串口;

	public final static native FileDescriptor getFD(int paramFd);//根据虚拟设备获取Java层的虚拟设备描述符;

	public final static native void close(int paramFd);//关闭已打开的虚拟设备文件;

	public final static native String cmdGets(String cmd);//执行shell命令;

	public final static native String version();//获取版本号;

	public final static native int chmod(String path, int mode);//写入权限;

	public final static native int kill(int pid);//结束进程;

	public final static native int cmdShell(String cmd);//执行Shell命令;

	public final static native int getPid();//当前当前进程ID;

	public final static native int getpPid();//获取当前进程的父进程ID;

	public final static native int cmdReboot();//重启;

	public static native String findUsb(String dev_Identifier);// find Usb Key Peripheral device;

	public static native int readUsbEvent(int iFd);// Read Usb Key Peripheral device;

	public static native int getcrc_16(byte[] buffer,int size);//check CRC_16 Value;

	static {
		System.loadLibrary("Dev");//加载类库;
	}

}
